﻿#region Using Directives

using System;

#endregion

namespace GeekRule.ORM.Entities
{
    /// <summary>
    /// Drives mapping of data-to-entity properties
    /// </summary>
    public enum FieldMappingMode
    {
        /// <summary>
        /// Property name and field name must match
        /// </summary>
        Strict,

        /// <summary>
        /// FieldName will be used to map data to property
        /// </summary>
        Mapped,

        /// <summary>
        /// Do not map this field
        /// </summary>
        Ignore
    }

    /// <summary>
    /// Can be used to decorate entity properties to drive ORM mapping.
    /// </summary>
    /// <remarks>
    /// The FieldName value sets the expected data result set field name value.
    /// This can be used to support non-standard mappings such as reader["FName"] to map to entity.FirstName
    /// in instances when query field aliasing cannot be used.
    /// </remarks>
    public class FieldMappingAttribute : Attribute
    {
        public FieldMappingMode MappingMode { get; set; }
        public string FieldName { get; set; }
    }
}
